package com.vhall.component.framework.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import lombok.Getter;

/**
 * 异常状态
 *
 * @author xiaoliang.wang@vhall.com
 */
@Getter
@JsonInclude(Include.NON_NULL)
public class DebugThrowable {

    /**
     * 原因
     */
    private String cause;

    /**
     * 堆栈信息
     */
    private String stack;

    /**
     * 异常类型
     */
    private String type;

    public DebugThrowable(Throwable cause, String stack) {
        this.cause = cause.getMessage();
        this.type = cause.getClass().getName();
        this.stack = stack;
    }

}
